package org.lcb.demo.shiyan3.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import pojo.Product;

import java.util.List;
@Mapper
public interface ProductMapper {
    //获取所有的产品列表
    @Select("select * from product")
    List<Product> selectProductList();

    //根据分类id进行筛选产品
    @Select("select * from Product where category_id=#{categoryId}")
    List<Product> selectProductByCategoryId(int categoryId);

    //查找某个产品id的产品
    @Select("select * from Product where id = #{id}")
    Product selectProductById(int id);


}
